package cn.ydxiaoshaui.aip.imageclassify.bean;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

import java.io.Serializable;

/**
 * @Description 图像主体检测
 * @author 小帅丶
 * @className ObjectDetect
 * @Date 2019/9/26
 **/
public class ObjectDetect implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 唯一的log id，用于问题定位 */
    private Long log_id;
    /** 裁剪结果 */
    private Result result;

    public Long getLog_id() {
        return log_id;
    }

    public void setLog_id(Long log_id) {
        this.log_id = log_id;
    }

    public Result getResult() {
        return result;
    }

    public void setResult(Result result) {
        this.result = result;
    }

    private static class Result{
        /** 表示定位位置的长方形左上顶点的垂直坐标 */
        private Integer top;
        /** 表示定位位置的长方形左上顶点的水平坐标 */
        private Integer left;
        /** 表示定位位置的长方形的宽度 */
        private Integer width;
        /** 表示定位位置的长方形的高度 */
        private Integer height;

        public Integer getTop() {
            return top;
        }

        public void setTop(Integer top) {
            this.top = top;
        }

        public Integer getLeft() {
            return left;
        }

        public void setLeft(Integer left) {
            this.left = left;
        }

        public Integer getWidth() {
            return width;
        }

        public void setWidth(Integer width) {
            this.width = width;
        }

        public Integer getHeight() {
            return height;
        }

        public void setHeight(Integer height) {
            this.height = height;
        }
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this, new SerializerFeature[] {
                SerializerFeature.WriteMapNullValue,
                SerializerFeature.WriteNullListAsEmpty,
                SerializerFeature.WriteNullStringAsEmpty,
                SerializerFeature.WriteNullNumberAsZero,
                SerializerFeature.WriteNullBooleanAsFalse,
                SerializerFeature.UseISO8601DateFormat });
    }
}
